const { resetPort, runShell } = require('./views-utils')
const path = require('path')
/**
 * 检查项目文件
 * 1.获取所有的控制器
 * 2.获取所有的business-server
 * 3.获取所有的models
 */
function checkProjectFiles() {}

/**
 * 启动项目
 */
function startExmdViews({ port, apiPort }) {
  resetPort(port, () => {
    console.log(`启动exmd辅助功能，端口在${apiPort}`)
    // runShell(`cd ${path.resolve('node_modules')}/exmd-auxiliary && serve -s dist --listen ${apiPort}`)
    runShell(`serve -s dist --listen ${apiPort}`)
  })
}

module.exports = {
  checkProjectFiles,
  startExmdViews
}
